package zxq.rollcall.course.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import zxq.rollcall.course.entity.enums.ERoles;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author Yanghu
 * @since 2020-01-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SYSTEM_USER_TABLE")
public class SystemUserTableEntity extends Model<SystemUserTableEntity> {

    private static final long serialVersionUID=1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名称
     */
    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private String userName;

    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private String nickName;
    /**
     * 用户密码
     */
    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private String userPassword;

    /**
     * 角色id
     */
    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private ERoles roleId;

    /**
     * 班级id（角色为学生的时候专用，因为一个学生对应一个班级）
     */
    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private Integer classId;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
